#ifndef GRITC_SERVER_ROOM_HPP
#define GRITC_SERVER_ROOM_HPP

#include <vector>
#include <algorithm>

namespace gritc { namespace server {

	template<class Traits> struct room
	{
		typedef Traits traits_type;
		typedef typename Traits::actor_type actor_type;
		typedef std::stringstream response_type;
		typedef std::vector<actor_type*> actor_list;

		response_type response_;
		response_type & response() { return response_; }

		actor_list actors_;
		actor_list & actors() { return actors_; }
	};

	struct tick_room_
	{
		template<class Room, class Tick, class Pointer> 
		void operator ()(Room & room_, Tick & tick_, Pointer & pointer_) const
		{
			typedef Room::actor_list List;
			List & l = room_.actors();
			for(List::iterator i = l.begin(); i != l.end(); ++i)
				tick_actor(**i, tick_, pointer_);
		}
	} const tick_room;
}}

#endif